import { defineNuxtPlugin } from '#app'
import fs from 'node:fs'

export default defineNuxtPlugin((nuxtApp) => {
  nuxtApp.provide('readFile', (filePath: string) => {
    if (process.server) {
      return fs.readFileSync(filePath, 'utf8')
    }
    return ''
  })
})